In elisp is there a difference between the regex [\\]documentclass and \\documentclass?

Posted by mcheema on Stack Overflow See other posts from Stack Overflow or by mcheema
Published on 2012-06-02T13:48:49Z Indexed on 2012/06/03 10:40 UTC
Read the original article Hit count: 182

Filed under:
|

I was playing around with the rx function for generating regular expressions from sexps in ELISP but couldn't figure out how to generate the regular expression "\\documentclass" for use in org-export-latex-classes:

    (rx "\\documentclass")
    (rx "\\" "documentclass")
    (rx (char "\\") "documentclass")

Which when evaluated give respectively the following outputs:

    "\\\\documentclass"
    "\\\\documentclass"
    "[\\]documentclass"

Is "\\documentclass" equivalent to "[\\]documentclass"?---I think it is, but am not sure. Can I generate the former using rx?

Edit: Whilst the question was valid I realize my motivation was not; because org-export-latex-classes use strings not regular expressions.

© Stack Overflow or respective owner

Related posts about emacs

Related posts about elisp